package org.example.mppg.logic.service.impl;

import cn.hutool.json.JSONObject;
import jakarta.annotation.Resource;
import org.example.mppg.domain.entity.Student;
import org.example.mppg.repository.sql.mapper.StudentMapper;
import org.example.mppg.logic.service.IStudentService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 学生信息表 服务实现类
 * </p>
 *
 * @author bo
 * @since 2024-10-14
 */
@Service
public class StudentServiceImpl extends ServiceImpl<StudentMapper, Student> implements IStudentService {

    @Resource
    private StudentMapper studentMapper;

    @Override
    public void truncate() {
        studentMapper.truncate();
    }

    @Override
    public List<Student> getStudentsByInfoItem(JSONObject infoItem) {
        return studentMapper.getStudentsByInfoItem(infoItem.toString());
    }

    @Override
    public List<Student> getStudentsByInfoItemValue(String value) {
        return studentMapper.getStudentsByInfoItemValue(value);
    }
}
